Problems with margins, paddings, divs and floats! PLEASE HELP!
am 09.05.2007 20:30:27 von AgixHI there,
I am fairly new to web coding, not so new I don't know what tags are
or anything that basic, but new enough to be frustrated by obstacles
that trying to use multiple browsers is causing and not knowing the
way round it.
Here I must stress I AM NOT LOOKING for workarounds or fixes or hacks
per s=E9, but more for an explanation of why I see this behaviour - my
experienced friend coder doesn't seem to understand my plight.
I have even include a link to the offending page
http://www.clarifysolutions.co.uk/certenroll/
Now this is just a test page I was making and playing around with CSS.
This is a copy of my CSS:
************************************************************ ***************=
****************
body
{
background-color:#000000;
margin:5px;
padding:0px;
}
#mainpageset
{
width:560px;
background-image:url(abackground.gif);
padding:0px;
margin:0px
height:595px;
}
#navbarmain
{
margin:0px;
padding:0px;
width:375px;
height:30px;
}
..buttonbarmain
{
width:75px;
height:30px;
float:right;
background-image:url(button.rest1.gif);
background-repeat:no-repeat;
text-align:center;
padding:0px;
margin:0px;
font-family:Geneva, Arial, Helvetica, sans-serif;
}
..buttonbarmain:hover
{
background-image:url(button.active1.gif);
}
..linktextbarmain
{
text-align:center;
font-family:Arial, Helvetica, sans-serif;
margin:0px;
padding:0px;
}
#adbarright
{
float:right;
text-align:center;
color:#000066;
border: solid #00CC66 1px;
width:160px;
padding:0px;
margin:0px;
height:590px;
}
#mainpagecont
{
border:solid 1px #00CC66;
width:400px;
height:560px;
padding:0px;
margin:0px;
overflow:hidden;
}
..adbarimage
{
width:160px;
height:auto;
margin:0px;
padding:0px;
}
**************************** END CSS
**************************************
If you take a look at particularly "#mainpageset" this is a div tag
container for the entire page contents. It has it's width set to
560px.
Notice how I have set EVERY id and class to have margin AND padding =3D
0px. This is so I can work out how the browser is behaving.
Secondly, take note of "#mainpagecont" and "#adbarright" - 400px and
160px respectively in width.
If you take a look at the link in Firefox - it renders ok, but messes
up a fair bit. In IE6+7 it looks plain awful. What I am really annoyed
about is that the two divs, no margins or paddings but they still
overlap!!!!
Correct me if i'm wrong but - 400px + 160 px =3D 560px , no?!?!?! Why
does the browser not follow mathematics?
HELP!
HTML Included to be helpful....
************************************************************ ***************=
******************
ADS!
Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem
Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum
Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem
Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum